﻿<Window x:Class="VsSpeakerCompanion.UI.LoginWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Demo Dashboard" 
    Name="window"
    Width="300" Height="360"
    RenderTransformOrigin="0.5,0.5"
    ResizeMode="NoResize" WindowStyle="None" Background="Transparent" AllowsTransparency="True" ShowInTaskbar="True">
    <Window.Resources>
        <ImageSource x:Key="backgroundImage">..\Resources\sidebar_BG.png</ImageSource>
        <Storyboard x:Key="OpenWindowAnimation">
            <DoubleAnimation From="0" To="1" Storyboard.TargetName="window" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Duration="00:00:00.3" />
            <DoubleAnimation From="0" To="1" Storyboard.TargetName="window" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Duration="00:00:00.3" />
        </Storyboard>
        <Storyboard x:Key="CloseWindowAnimation">
            <DoubleAnimation From="1" To="0" Storyboard.TargetName="window" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)" Duration="00:00:00.3" Completed="CloseWindowAnimationCompleted" />
            <DoubleAnimation From="1" To="0" Storyboard.TargetName="window" Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)" Duration="00:00:00.3" Completed="CloseWindowAnimationCompleted" />
        </Storyboard>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource OpenWindowAnimation}" />
        </EventTrigger>
        <EventTrigger RoutedEvent="FrameworkElement.Unloaded">
            <BeginStoryboard Storyboard="{StaticResource CloseWindowAnimation}" />
        </EventTrigger>
    </Window.Triggers>
    <Window.RenderTransform>
        <ScaleTransform />
    </Window.RenderTransform>
    <Border Margin="10" BorderBrush="White" CornerRadius="10"  BorderThickness="3">
        <Border.Background>
            <ImageBrush ImageSource="{StaticResource backgroundImage}" Stretch="Fill" />
        </Border.Background>
        <Grid >
            <Grid Name="contentGrid" />
            <Grid VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-6,-6,0">
                <Grid.Triggers>
                    <EventTrigger RoutedEvent="UIElement.MouseLeftButtonUp">
                        <BeginStoryboard Storyboard="{StaticResource CloseWindowAnimation}" />
                    </EventTrigger>
                </Grid.Triggers>
                <Ellipse Fill="Black" Width="20" Height="20" Stretch="Fill" />
                <Line X1="0" Y1="0" X2="10" Y2="10" Stroke="White" StrokeThickness="2" Margin="5,5,0,0"  />
                <Line X1="10" Y1="0" X2="0" Y2="10" Stroke="White" StrokeThickness="2" Margin="5,5,0,0" />
            </Grid>
        </Grid>
    </Border>
</Window>
